// 轮播图数据 API
export default defineEventHandler(async (event) => {
  const query = getQuery(event)
  const delay = query.delay ? Number(query.delay) : 0
  
  if (delay > 0) {
    await new Promise(resolve => setTimeout(resolve, delay))
  }

  const banners = [
    {
      id: 1,
      title: '双十一狂欢购',
      subtitle: '全场5折起',
      image: 'https://images.unsplash.com/photo-1607082348824-0a96f2a4b9da?w=1200&h=400&fit=crop',
      link: '/promotion/1'
    },
    {
      id: 2,
      title: '新品首发',
      subtitle: '限时优惠',
      image: 'https://images.unsplash.com/photo-1607082349566-187342175e2f?w=1200&h=400&fit=crop',
      link: '/promotion/2'
    },
    {
      id: 3,
      title: '会员专享',
      subtitle: '额外95折',
      image: 'https://images.unsplash.com/photo-1607083206968-13611e3d76db?w=1200&h=400&fit=crop',
      link: '/promotion/3'
    }
  ]

  return {
    success: true,
    data: banners
  }
})

